WindowWrite Node
The WindowWrite Node
gets a timestamp
to the Input Port
, applies the aggregation function to the time window
that matches the timestamp
, appends aggregate in the Window Collection
, and sends the window timestamp
to the Output Port
.
The WindowWrite Node
may get optional values
for the input key
and value
Ports.
The WindowWrite Node
requires Configuration Parameters
to be defined:
Aggregator
. The function which is applied to the input value from the following listSUM
,MEAN
,MAX
,MIN
.Expiration Time
. TheWindow
older then theExpiration time
is deleted automatically.Expiration time
is limited by172800 sec
(48 hours).Collection name
. The name for the collection of aggregates.Collection name
is used by theWindowRead Node
to request the collection.Window size
. The duration of theWindow
in seconds from0
to172800 sec
(48 hours).Step size
The offset between neighbourWindows
in seconds from0
to172800 seс
(48 hours).
Examples
Assume that the WindowWrite Node
receives 10 events having the following values:
"ts": 1000000000, "key": "A", "value": 1
"ts": 1000000001, "key": "B", "value": 2
"ts": 1000000002, "key": "C", "value": 3
"ts": 1000000003, "key": "A", "value": 4
"ts": 1000000004, "key": "B", "value": 5
"ts": 1000000005, "key": "C", "value": 6
"ts": 1000000006, "key": "A", "value": 7
"ts": 1000000007, "key": "B", "value": 8
"ts": 1000000008, "key": "C", "value": 9
"ts": 1000000009, "key": "A", "value": 10
The Configuration Parameters
are the following:
Window size
=5 sec
Step size
=5 sec
The WindowWrite Node
will collect aggregates for the 2 following intervals:
[0-5] sec [1000000000, 1000000005)
[5-10] sec [1000000005, 1000000010)
The following aggregates will be counted:
Total number of events witthin [0-5) Window : 5
Total number of events witthin [6-10) Window : 5
[0-5) Window
"key" : "A" | "key" : "B" | "key" : "C" |
---|---|---|
COUNT : 2 | COUNT : 2 | COUNT : 1 |
SUM : 5 | SUM : 7 | SUM : 3 |
MEAN : 2.5 | MEAN : 3.5 | MEAN : 3 |
MAX : 4 | MAX : 5 | MAX : 3 |
MIN : 1 | MIN : 2 | MIN : 3 |
[6-10) Window
"key" : "A" | "key" : "B" | "key" : "C" |
---|---|---|
COUNT : 2 | COUNT : 1 | COUNT : 2 |
SUM : 17 | SUM : 8 | SUM : 15 |
MEAN : 8.5 | MEAN : 8 | MEAN : 7.5 |
MAX : 10 | MAX : 8 | MAX : 9 |
MIN : 7 | MIN : 8 | MIN : 6 |